-
Notifications
You must be signed in to change notification settings - Fork 28.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-45710][SQL] Assign names to error _LEGACY_ERROR_TEMP_21[59,60,61,62] #43567
Conversation
The use of the 4 similar errors is a bit confusing, we have separate errors for flatten/concat/union, but we are using |
6c3cfba
to
921b9f1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dengziming There is another similar error class TOO_MANY_ARRAY_ELEMENTS
. I would create new error class like COLLECTION_SIZE_LIMIT_EXCEEDED
with sub-classes.
921b9f1
to
9827199
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except of some comments. @dengziming Please, update PR's description according to your recent changes.
}, | ||
"INITIALIZE" : { | ||
"message" : [ | ||
"cannot initialize array with specified parameters." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"cannot initialize array with specified parameters." | |
"cannot initialize an array with specified parameters." |
"subClass" : { | ||
"FUNCTION" : { | ||
"message" : [ | ||
"unsuccessful try to create arrays in function <functionName>." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"unsuccessful try to create arrays in function <functionName>." | |
"unsuccessful try to create arrays in the function <functionName>." |
}, | ||
"PARAMETER" : { | ||
"message" : [ | ||
"the value of parameter(s) <parameter> in <functionName> is invalid." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"the value of parameter(s) <parameter> in <functionName> is invalid." | |
"the value of parameter(s) <parameter> in the function <functionName> is invalid." |
sql/core/src/test/scala/org/apache/spark/sql/errors/QueryExecutionErrorsSuite.scala
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Waiting for CI.
new SparkIllegalArgumentException( | ||
errorClass = "TOO_MANY_ARRAY_ELEMENTS", | ||
errorClass = "COLLECTION_SIZE_LIMIT_EXCEEDED", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a sub-class.
The failed python GA is not related to the changes, and it passed a couple commits above. |
What changes were proposed in this pull request?
This PR are removing
_LEGACY_ERROR_TEMP_21[59,60,61,62]
andTOO_MANY_ARRAY_ELEMENTS
:_LEGACY_ERROR_TEMP_2159
is used in concat/array_insert;_LEGACY_ERROR_TEMP_2160
is only used in flatten;_LEGACY_ERROR_TEMP_2161
is used in array_repeat/array_insert/array_distinct/array_union/array_intersect/array_remove;_LEGACY_ERROR_TEMP_2162
is used in array_union/array_distinct;TOO_MANY_ARRAY_ELEMENTS
which are used inUnsafeArrayWriter.java
.I removed these 5 similar error classes and create a new error class
COLLECTION_SIZE_LIMIT_EXCEEDED
with 3 sub-classes:PARAMETER
is used when the parameter exceed size limit, such asarray_repeat
with count too large;FUNCTION
is used when trying to create an array exceeding size limit in a function, for example, flatten 2 arrays to a larger array;INITIALIZE
is used inUnsafeArrayWriter.java
when trying to initialize an array exceeding size limit.Why are the changes needed?
To assign proper name as a part of activity in SPARK-37935.
Does this PR introduce any user-facing change?
Yes, the error message will include the error class name.
How was this patch tested?
COLLECTION_SIZE_LIMIT_EXCEEDED.PARAMETER
can be tested from use code;COLLECTION_SIZE_LIMIT_EXCEEDED.FUNCTION
is tested using aColumnarArray
inconcat/flatten
, but can't be tested inarray_insert/array_distinct/array_union/array_intersect/array_remove
since we need to deduplicate the data and create an array which will cause OOM.INITIALIZE
is already tested in a existing case.Was this patch authored or co-authored using generative AI tooling?
No.